﻿<%@ Register TagPrefix="ucCommon" TagName="Common" Src="../Common/Inc/Common.ascx" %>
<%@ Register TagPrefix="ucTop" TagName="Top" Src="../Common/Inc/Top.ascx" %>
<%@ Register TagPrefix="ucMenu" TagName="Menu" Src="../Common/Inc/Menu.ascx" %>
<%@ Register TagPrefix="ucTabTitle" TagName="TabTitle" Src="../Common/Inc/TabTitle.ascx" %>
<%@ Register TagPrefix="ucCopyright" TagName="Copyright" Src="../Common/Inc/Copyright.ascx" %>
<%@ Register Assembly="ChartFX.WebForms" Namespace="ChartFX.WebForms" TagPrefix="chartfx7" %>
<%@ Register Assembly="ChartFX.WebForms.Adornments" Namespace="ChartFX.WebForms.Adornments" TagPrefix="chartfxadornments" %>
<%@ Register Assembly="ChartFX.WebForms" Namespace="ChartFX.WebForms.Galleries" TagPrefix="chartfx7galleries" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Fit2010r.aspx.cs" Inherits="Updms.Fit.Fit2010r" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>▒ UPDMS [Fit2010r] ▒▒▒▒▒▒▒▒▒▒</title>
<ucCommon:Common id="Common" runat="server"></ucCommon:Common>
</head>
<body onload="setResize();initMenu();">
<form id="form1" runat="server">
<asp:ScriptManager runat="server" id="ScriptManager1" EnableScriptGlobalization="true"></asp:ScriptManager>

<table id="table_frame">
<tr>
	<td id="top_area" colspan="2">
		<!-- Top 시작 -->
		<ucTop:Top id="Top" runat="server"></ucTop:Top>
		<!-- Top 끝 -->	
	</td>
</tr>
<tr>
	<td id="menu_area">
		<!-- 메뉴 시작 -->
		<ucMenu:Menu id="Menu" runat="server"></ucMenu:Menu>
		<!-- 메뉴 끝 -->	
	</td>
	<td id="contents_area">
		<!-- 제목 시작 -->
		<ucTabTitle:TabTitle id="TabTitle" TagPrefixs="Fit2010r" runat="server"></ucTabTitle:TabTitle>
		<!-- 제목 끝 -->
		<!-- AJAX 시작 -->
		<asp:UpdatePanel ID="UpdatePanel1" runat="server">
		<Triggers>
			<asp:PostBackTrigger ControlID="ibtn_excel"/>
		</Triggers>
		<ContentTemplate>
		<!-- 버튼 시작 -->
		<div class="button_area">
			<asp:linkbutton id="ibtn_excel" Text="엑셀" runat="server" CssClass="ibtn ibtn_excel" OnClick="ibtn_excel_Click"></asp:linkbutton>
			<asp:linkbutton id="ibtn_favorite" Text="즐겨찾기" runat="server" CssClass="ibtn ibtn_favorite"></asp:linkbutton>
			<asp:linkbutton id="ibtn_search" Text="검색" runat="server" CssClass="ibtn ibtn_search" OnClientClick="return chkSearch()" OnClick="ibtn_search_Click"></asp:linkbutton>
		</div>
		<!-- 버튼 끝 -->
		<!-- 검색 시작 -->
		<table class="table_search">
		<tr>
			<td class="lbl" width="11%"><asp:Literal id="ltr_search_region" Text="검색기간" runat="server" /></td>
			<td class="ctl" width="30%">
				<ul class="horizontal">
					<li><asp:dropdownlist id="ddl_search_from_year" runat="server"></asp:dropdownlist><asp:dropdownlist id="ddl_search_from_month" runat="server">
							<asp:ListItem Value="01">01</asp:ListItem>
							<asp:ListItem Value="02">02</asp:ListItem>
							<asp:ListItem Value="03">03</asp:ListItem>
							<asp:ListItem Value="04">04</asp:ListItem>
							<asp:ListItem Value="05">05</asp:ListItem>
							<asp:ListItem Value="06">06</asp:ListItem>
							<asp:ListItem Value="07">07</asp:ListItem>
							<asp:ListItem Value="08">08</asp:ListItem>
							<asp:ListItem Value="09">09</asp:ListItem>
							<asp:ListItem Value="10">10</asp:ListItem>
							<asp:ListItem Value="11">11</asp:ListItem>
							<asp:ListItem Value="12">12</asp:ListItem>
						</asp:dropdownlist>&nbsp;~&nbsp;<asp:dropdownlist id="ddl_search_to_year" runat="server"></asp:dropdownlist><asp:dropdownlist id="ddl_search_to_month" runat="server">
							<asp:ListItem Value="01">01</asp:ListItem>
							<asp:ListItem Value="02">02</asp:ListItem>
							<asp:ListItem Value="03">03</asp:ListItem>
							<asp:ListItem Value="04">04</asp:ListItem>
							<asp:ListItem Value="05">05</asp:ListItem>
							<asp:ListItem Value="06">06</asp:ListItem>
							<asp:ListItem Value="07">07</asp:ListItem>
							<asp:ListItem Value="08">08</asp:ListItem>
							<asp:ListItem Value="09">09</asp:ListItem>
							<asp:ListItem Value="10">10</asp:ListItem>
							<asp:ListItem Value="11">11</asp:ListItem>
							<asp:ListItem Value="12">12</asp:ListItem>
						</asp:dropdownlist>&nbsp;<asp:linkbutton id="sbtn_6_m" runat="server" ToolTip="6개월" OnClick="sbtn_6_m_Click"><img src="../Common/Images/calendar_6m.gif" align="top"></asp:linkbutton><asp:linkbutton id="sbtn_12_m" runat="server" ToolTip="12개월" OnClick="sbtn_12_m_Click"><img src="../Common/Images/calendar_12m.gif" align="top"></asp:linkbutton><asp:linkbutton id="sbtn_all_m" runat="server" ToolTip="전체" OnClick="sbtn_all_m_Click"><img src="../Common/Images/calendar_all.gif" align="top"></asp:linkbutton>
					</li>
					<li style="padding:0 0 0 4px;"><asp:linkbutton id="ibtn_prev_year" ToolTip="전년" runat="server" OnClick="ibtn_prev_year_Click"><img src="../Common/Images/arrow_rect_left.gif" alt="전년" /></asp:linkbutton>
					<asp:linkbutton id="ibtn_this_year" ToolTip="당년" runat="server" OnClick="ibtn_this_year_Click"><img src="../Common/Images/control_rect_stop.gif" alt="당년" /></asp:linkbutton>
					<asp:linkbutton id="ibtn_next_year" ToolTip="차년" runat="server" OnClick="ibtn_next_year_Click"><img src="../Common/Images/arrow_rect_right.gif" alt="차년" /></asp:linkbutton></li>
				</ul>
			</td>
			<td class="lbl" width="11%"><asp:Literal id="ltr_search_training_part" Text="운동부위" runat="server" /></td>
			<td class="ctl" width="6%"><img src="../Common/Images/application_form.png" align="absmiddle" alt="multi_check" class="hand" onclick="showHiddenDiv('div_search_training_part', event);" /></td>
			<td class="lbl" width="11%"><asp:Literal id="ltr_search_training_type" Text="운동명" runat="server" /></td>
			<td class="ctl" width="6%"><img src="../Common/Images/application_form.png" align="absmiddle" alt="multi_check" class="hand" onclick="showHiddenDiv('div_search_training_type', event);" /></td>
			<td class="lbl" width="10%"><asp:Literal id="ltr_search_type" Text="조회타입" runat="server" /></td>
			<td class="ctl" width="15%"><asp:RadioButtonList id="rbl_search_type" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" CssClass="rbl_flow"></asp:RadioButtonList></td>
		</tr>
		</table>
		<!-- 검색 끝 -->
		<!-- 챠트 시작 -->
		<table cellpadding="0" cellspacing="0" border="0" width="100%">
		<tr>
			<td style="width:253px" valign="top">
				<!-- 운동부위별 총량 챠트 시작 -->
				<div class="sub_title_icon"><asp:Literal id="ltr_total_weight_count_by_training_part" Text="운동부위별 총량" runat="server" /><asp:Literal id="ltr_total_weight_or_count_pie" Text="" runat="server" /></div>
				<table class="default">
					<tr>
						<td class="td_box">
							<chartfx7:Chart ID="chart_total_weight_count_by_training_part" runat="server" Palette="DarkPastels.Pastels" Height="260px" ImageSettings-Interactive="False" Width="251px">
								<AxisY Title-Text="">
									<Grids Major-Style="Solid" Interlaced="True"></Grids>
									<LabelsFormat CustomFormat="###,###,##0" />
								</AxisY>

								<AxisX Title-Text="">
								<Grids Major-Visible="False"></Grids>
								</AxisX>

								<AllSeries Gallery="Pie" PointLabels-BackColor="Transparent"></AllSeries>

								<LegendBox Dock="Top" Visible="false"></LegendBox>

								<MainPane AxisY-Title-Text=""></MainPane>
								<SpecialObjects>
									<chartfxadornments:SimpleBorder AssemblyName="ChartFX.WebForms.Adornments" Color="Transparent"
										Type="None">
									</chartfxadornments:SimpleBorder>
									<chartfxadornments:GradientBackground AssemblyName="ChartFX.WebForms.Adornments"
										ColorFrom="Transparent" EffectArea="0">
									</chartfxadornments:GradientBackground>
									<chartfx7galleries:Pie ExplodingMode="All" Shadows="True" SliceSeparation="10">
									</chartfx7galleries:Pie>
								</SpecialObjects>
								<View3D Enabled="True" />
								<Series>
									<chartfx7:SeriesAttributes MarkerStep="3" />
									<chartfx7:SeriesAttributes />
									<chartfx7:SeriesAttributes />
								</Series>
							</chartfx7:Chart>
						</td>
					</tr>
				</table>
				<!-- 운동부위별 총량 챠트 끝 -->
			</td>
			<td valign="top">
				<!-- 월별트레이닝결과 챠트 시작 -->
				<div class="sub_title_icon"><asp:Literal ID="ltr_stitle_training_type" Text="월별트레이닝결과" runat="server" /><asp:Literal id="ltr_total_weight_or_count_line" Text="" runat="server" /></div>
				<table class="default">
					<tr>
						<td class="td_box" align="right">
							<chartfx7:chart id="chart_training_type" runat="server" height="260px" width="800px" Palette="ChartFX6.ChartFX6" ImageSettings-Interactive="False">
								<AxisY Title-Text="">
								<Grids Major-Style="Dash" Interlaced="True"></Grids>
									<LabelsFormat CustomFormat="###,###,##0" />
								</AxisY>

								<AxisX Title-Text="">
									<Grids Major-Visible="False"></Grids>
								</AxisX>

								<AllSeries PointLabels-Visible="True"></AllSeries>

								<LegendBox ContentLayout="Near" Dock="Bottom"></LegendBox>

								<MainPane AxisY-Title-Text=""></MainPane>

								<SpecialObjects>
									<chartfxadornments:SimpleBorder AssemblyName="ChartFX.WebForms.Adornments" Color="Transparent"
										Type="None">
									</chartfxadornments:SimpleBorder>
									<chartfxadornments:GradientBackground AssemblyName="ChartFX.WebForms.Adornments"
										ColorFrom="Transparent" EffectArea="0">
									</chartfxadornments:GradientBackground>
								</SpecialObjects>
							<Series>
								<chartfx7:SeriesAttributes />
								<chartfx7:SeriesAttributes />
								<chartfx7:SeriesAttributes />
							</Series>
							</chartfx7:chart>
						</td>
					</tr>
					<tr>
						<td height="10"></td>
					</tr>
				</table>
				<!-- 월별트레이닝결과 챠트 끝 -->
			</td>
		</tr>
		</table>
		<!-- 챠트 끝 -->
		<!-- 리스트셋 시작 -->			
		<table id="table_list_set" cellspacing="0" cellpadding="0" width="100%" border="0" runat="server">
			<tr>
				<td valign="top">
					<div class="div_scroll_x" style="width:253px">
					<asp:GridView ID="gv_training_info" CssClass="table_gridview" GridLines="None" runat="server" AutoGenerateColumns="False" OnRowDataBound="gv_training_info_RowDataBound" DataKeyNames="Training_Part,Training_Type_Id">
						<Columns>
							<asp:BoundField HeaderText="운동부위" DataField="Training_Part_Nm" HtmlEncode="False" >
								<ItemStyle HorizontalAlign="Left" Width="22%" />
								<HeaderStyle HorizontalAlign="Center" />
							</asp:BoundField>
							<asp:BoundField HeaderText="운동명" DataField="Training_Nm" HtmlEncode="False" >
								<ItemStyle HorizontalAlign="Left" Width="78%" />
								<HeaderStyle HorizontalAlign="Center" />
							</asp:BoundField>
						</Columns>
					</asp:GridView>
					</div>
				</td>
				<td valign="top">
					<div id="div_box" class="div_scroll_x">
					<asp:GridView ID="gv_data" CssClass="table_gridview" GridLines="None" runat="server" AutoGenerateColumns="True" OnRowDataBound="gv_data_RowDataBound" DataKeyNames="Training_Part,Training_Type_Id">
						<Columns>
						</Columns>
					</asp:GridView>
					</div>
				</td>
				<td valign="top">
					<div class="div_scroll_x" style="width:70px">
					<asp:GridView ID="gv_total" CssClass="table_gridview" GridLines="None" runat="server" AutoGenerateColumns="False" OnRowDataBound="gv_total_RowDataBound" DataKeyNames="Training_Part,Training_Type_Id">
						<Columns>
							<asp:BoundField HeaderText="총계" DataField="Total" HtmlEncode="False" >
								<ItemStyle HorizontalAlign="Right" Width="100%" />
								<HeaderStyle HorizontalAlign="Center" />
							</asp:BoundField>
						</Columns>
					</asp:GridView>
					</div>
				</td>
			</tr>
		</table>
		<table class="table_gridview" cellspacing="0" border="0" id="gv_data_nodata" style="border-collapse:collapse;" runat="server">
			<tr>
				<td><div id="no_data"></div></td>
			</tr>
		</table>
		<!-- 리스트셋 끝 -->
		<!-- 모달영역(운동부위별 챠트) 시작 -->
		<asp:Panel ID="Panel1" style="display:none;" runat="server">
			<div class="div_box">
			<img id="img_close_part" src="../Common/Images/close.gif" class="hand" style="float:right;" onclick="hideChartPart();" alt="닫기" /><br />
			<chartfx7:chart id="chart_line_part" runat="server" height="400px" width="1000px" Palette="ChartFX6.ChartFX6" ImageSettings-Interactive="False">
				<AxisY Title-Text="">
				<Grids Major-Style="Dash" Interlaced="True"></Grids>
					<LabelsFormat CustomFormat="###,###,##0.#" />
				</AxisY>

				<AxisX Title-Text="">
				<Grids Major-Visible="False"></Grids>
				</AxisX>

				<AllSeries PointLabels-Visible="True"></AllSeries>

				<LegendBox ContentLayout="Near" Dock="Bottom"></LegendBox>

				<MainPane AxisY-Title-Text=""></MainPane>
				<SpecialObjects>
					<chartfxadornments:SimpleBorder AssemblyName="ChartFX.WebForms.Adornments" Color="Transparent"
						Type="None">
					</chartfxadornments:SimpleBorder>
					<chartfxadornments:GradientBackground AssemblyName="ChartFX.WebForms.Adornments"
						ColorFrom="Transparent" EffectArea="0">
					</chartfxadornments:GradientBackground>
				</SpecialObjects>
			<Series>
				<chartfx7:SeriesAttributes />
			</Series>
			</chartfx7:chart>
			</div>
		</asp:Panel>
		<!-- 모달영역(운동부위별 챠트) 끝 -->
		<!-- 모달영역(운동별챠트) 시작 -->
		<asp:Panel ID="Panel2" style="display:none;" runat="server">
			<div class="div_box">
			<img id="img_close_type" src="../Common/Images/close.gif" class="hand" style="float:right;" onclick="hideChartType();" alt="닫기" /><br />
			<chartfx7:chart id="chart_line_type" runat="server" height="200px" width="1000px" Palette="ChartFX6.ChartFX6" ImageSettings-Interactive="False">
				<AxisY Title-Text="">
				<Grids Major-Style="Dash" Interlaced="True"></Grids>
					<LabelsFormat CustomFormat="###,###,##0.#" />
				</AxisY>

				<AxisX Title-Text="">
				<Grids Major-Visible="False"></Grids>
				</AxisX>

				<AllSeries PointLabels-Visible="True"></AllSeries>

				<LegendBox ContentLayout="Near" Dock="Bottom"></LegendBox>

				<MainPane AxisY-Title-Text=""></MainPane>
				<SpecialObjects>
					<chartfxadornments:SimpleBorder AssemblyName="ChartFX.WebForms.Adornments" Color="Transparent"
						Type="None">
					</chartfxadornments:SimpleBorder>
					<chartfxadornments:GradientBackground AssemblyName="ChartFX.WebForms.Adornments"
						ColorFrom="Transparent" EffectArea="0">
					</chartfxadornments:GradientBackground>
				</SpecialObjects>
			<Series>
				<chartfx7:SeriesAttributes />
			</Series>
			</chartfx7:chart>
			</div>
		</asp:Panel>
		<!-- 모달영역(운동별챠트) 끝 -->
		
		<div id="div_search_training_part" class="div_scroll div_multi_box" style="display:none;height:156px;width:120px;position:absolute;overflow-y:auto;">
			<asp:CheckBoxList id="cbl_search_training_part" runat="server" RepeatDirection="Vertical" CssClass="cbl_vertical"></asp:CheckBoxList>
		</div>
		<div id="div_search_training_type" class="div_scroll div_multi_box" style="display:none;height:200px;width:224px;position:absolute;overflow-y:auto;">
			<asp:CheckBoxList id="cbl_search_training_type" runat="server" RepeatDirection="Vertical" CssClass="cbl_vertical"></asp:CheckBoxList>
		</div>
		<!-- 카피라이트 시작 -->
		<ucCopyright:Copyright id="Copyright" runat="server"></ucCopyright:Copyright>
		<!-- 카피라이트 끝 -->
		<!-- 히든값 시작 -->
		<div id="hdn_data">
			<asp:label id="lbl_pk" runat="server"></asp:label>
			<asp:Label id="lbl_search_flag" runat="server"></asp:Label>
			<input type="hidden" id="h_training_part" name="h_training_part" value="" runat="server" />
			<input type="hidden" id="h_row_series_part" name="h_row_series_part" value="" runat="server" />
			<input type="hidden" id="h_row_idx" name="h_row_idx" value="" runat="server" />
			<input type="hidden" id="h_row_series_type" name="h_row_series_type" value="" runat="server" />
			<asp:LinkButton ID="lbtn_set_chart_part" OnClick="lbtn_set_chart_part_Click" runat="server" />
			<asp:LinkButton ID="lbtn_set_chart_type" OnClick="lbtn_set_chart_type_Click" runat="server" />
		</div>
		<!-- 히든값 끝 -->
		<act:ModalPopupExtender ID="mpe_chart_part" runat="server"
			BehaviorID="mpe_chart_part_b"
			TargetControlID="lbtn_set_chart_part"
			PopupControlID="Panel1"
			CancelControlID="img_close_part"
			BackgroundCssClass="modalBackground" />
		<act:ModalPopupExtender ID="mpe_chart_type" runat="server"
			BehaviorID="mpe_chart_type_b"
			TargetControlID="lbtn_set_chart_type"
			PopupControlID="Panel2"
			CancelControlID="img_close_type"
			BackgroundCssClass="modalBackground" />
		</ContentTemplate>
		</asp:UpdatePanel>
		<!-- AJAX 끝 -->
	</td>
</tr>
</table>

<asp:updateprogress AssociatedUpdatePanelID="UpdatePanel1" ID="updateProgress" runat="server">
	<progresstemplate>
		<div id="progressBackgroundFilter"></div>
		<div id="processMessage">
			<div id="processing"></div>
			<img src="../Common/Images/processing_img.gif" alt="" />
		</div>
	</progresstemplate>
</asp:updateprogress>

</form>
<script type="text/javascript" language="javascript" defer="defer">
	setTimeout("window.onresize=setResize", 0);

	//해상도에 맞게 넓이 재지정
	function setResize() {
		var div_box = $("div_box");
		var gridview = $("gv_data");
		var menuHide = $("menuHide");	//메뉴가 숨겨져 있는지 여부
		var menu_width = 508;			//메뉴가 보여지면 메뉴만큼 뺀다.	185(메뉴-펼쳐진) + 253(운동부위,운동명) + 70(Total)
		var gridview_width = "100%";	//그리드뷰 기본 넓이
		var chart_line = $("chart_training_type"); //라인챠트

		//메뉴가 숨겨지면
		if (menuHide != "undefined" && menuHide.style.display == "none") {
			menu_width = 356;	//33(메뉴-접힌) + 253(운동부위,운동명) + 70(Total)
		}

		var curr_width = document.documentElement.clientWidth;
		var windowWidth = curr_width - menu_width;

		div_box.style.width = windowWidth + "px"; //div_box
		chart_line.style.width = windowWidth + "px"; //chart_line

		//검색기간 차이개월수를 구해서 gridview1의 넓이를 지정 (12개월보다 작으면 100%, 크면 개월수 * 62px)
		var from_dt = $F("ddl_search_from_year") + $F("ddl_search_from_month");
		var to_dt = $F("ddl_search_to_year") + $F("ddl_search_to_month");
		var diff = getDiffMonth(from_dt, to_dt);

		//해상도별 기본 조회 컬럼수
		//1280px : 12개월
		//1600px : 17개월
		//1920px : 22개월
		if (curr_width < 1280) {
			if (diff > 12) {
				gridview_width = (diff * 62) + "px";
			}
			else {
				gridview_width = "100%";
			}
		}
		else if (1280 <= curr_width < 1600) {
			if (diff > 17) {
				gridview_width = (diff * 62) + "px";
			}
			else {
				gridview_width = "100%";
			}
		}
		else if (1600 < curr_width) {
			if (diff > 22) {
				gridview_width = (diff * 62) + "px";
			}
			else {
				gridview_width = "100%";
			}
		}

		gridview.style.width = gridview_width;
	}

	//검색
	function chkSearch() {
		var from_dt = $F("ddl_search_from_year") + $F("ddl_search_from_month");
		var to_dt = $F("ddl_search_to_year") + $F("ddl_search_to_month");

		//검색기간
		if (!isDateSeq(from_dt, to_dt)) {
			msgBox.alert(getMsg(MSG_ERR_022)); //시작일자가 종료일자보다 늦을수 없습니다
			return false;
		}

		return true;
	}

	//운동부위별챠트
	function viewChartPart(trainingPart) {
		$("h_training_part").value = trainingPart;

		__doPostBack('lbtn_set_chart_part', '');
	}

	//운동별챠트
	function viewChartType(idx, series) {
		$("h_row_idx").value = idx;
		$("h_row_series_type").value = series;

		__doPostBack('lbtn_set_chart_type', '');
	}

	//운동부위별챠트 숨기기
	function hideChartPart() {
		var mpeBehavior = $find('mpe_chart_part_b');
		mpeBehavior.hide();
	}

	//운동별챠트 숨기기
	function hideChartType() {
		var mpeBehavior = $find('mpe_chart_type_b');
		mpeBehavior.hide();
	}

</script>

</body>
</html>